/*
*
==============================================================================
*  Name        : 
*  Part of     : Omen Game Engine - DirectX 10 Plugin
*  Description : 
*  Version     : 1.0
*
*  Copyright (c) 2013 Lauri Kortevaara.
* 
==============================================================================
*/

#ifndef _DirectX_10_Texture_H_
#define _DirectX_10_Texture_H_

#include "Config.h"

/// Omen Headers
#include <IOmenTexture.h>


/// DirectX 10 API Headers
#include <d3d10.h>
#include <d3dx10.h>

namespace Omen 
{
    ////////////////////////////////////////////////////////////////////////////////
    // Class name: DirectX_10_Texture
    ////////////////////////////////////////////////////////////////////////////////
    class DIRECTX_10_PLUGIN_API DirectX_10_Texture : public Omen::ITexture
    {
        #define UUID_DIRECTX_10_TEXTURE "F7DCEF5C-81C5-4f0e-B941-60555E47E721"

    public:
        virtual Omen_GUID classId() const { return OMEN_UUID(UUID_DIRECTX_10_TEXTURE); }    /// <summary>Defines the class ID</summary>

        DirectX_10_Texture( const std::wstring& filename );
        DirectX_10_Texture(const DirectX_10_Texture&);
        ~DirectX_10_Texture();

        bool Initialize( ID3D10Device* );
        void Shutdown();

        ID3D10ShaderResourceView*    GetTexture();


        /// ITexture
        virtual void setFilePath( const std::wstring& filePath )  {m_fileName = filePath;}
        virtual std::wstring filePath() const  {return m_fileName;}
        virtual std::wstring& filePath()  {return m_fileName;}

        virtual Omen::Float u_scale() const  {return 1.0;}
        virtual Omen::Float v_scale() const  {return 1.0;}
        virtual Omen::Float u_offset() const  {return 0.0;}
        virtual Omen::Float v_offset() const  {return 0.0;}

        virtual Omen::Float rotation() const  {return 0.0;}
        virtual WORD tiling() const  {return 0;}

        virtual void set_u_scale(Omen::Float scale)  {}
        virtual void set_v_scale(Omen::Float scale)  {}
        virtual void set_u_offset(Omen::Float offset)  {}
        virtual void set_v_offset(Omen::Float offset)  {}

        virtual void setRotation(Omen::Float rotation)  {}
        virtual void setTiling( WORD tiling)  {}

    private:
        #pragma warning(disable:4251) // Disable warning about private member variable needs to have dll-interface to be used by clients of class 'this'
        std::wstring                m_fileName;
        ID3D10ShaderResourceView*   m_pTexture;
        #pragma warning(default:4251) //

    };

} // namespace Omen
#endif